-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Regression: Loc raising when indexing mi with one level #45785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -3128,7 +3128,12 @@ def maybe_mi_droplevels(indexer, levels): | |||
# e.g. test_partial_string_timestamp_multiindex | |||
return indexer, self[indexer] | |||
|
|||
return indexer, maybe_mi_droplevels(indexer, [level]) | |||
try: | |||
result_index = maybe_mi_droplevels(indexer, [level]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm can we handle this inside?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh i c @jbrockmendel moved this. can you document this in the doc-string of maybe_mi_droplevels? (and prob should just move maybe_mi_droplevels) top a non-nested function (ok with these being a followup on main as well).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a note. Would like to move in a separate pr to not backport this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great, yeah ideally clean in 1.5
@meeseeksdev backport 1.4.x |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
@phofl if you wouldn't mind push a backport PR |
…i with one level
… level (#45895) Co-authored-by: Patrick Hoefler <[email protected]>
Thx for the backport @simonjayhawkins |
.loc
raises with an unclear error (in 1.4) #45779 (Replace xxxx with the Github issue number)doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.@jbrockmendel You moved the error catching logic out of maybe_mi_droplevels. Is this necessary for one of the other code paths?